# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : p9.py
# @Time     : 2024/5/8 23:02
# @Author   : Robot-Zsj
"""
description:

小华地图寻宝

https://fcqian.blog.csdn.net/article/details/134674604

i:
40 40 18

o:
1484
"""
# bfs

m, n, k = map(int, input().split())

visited = set()
offsets = ((-1, 0), (0, -1), (1, 0), (0, 1))

digitSums = [0] * (max(m, n))

for i in range(len(digitSums)):
    num = i
    while num > 0:
        digitSums[i] += num % 10
        num //= 10


def bfs():
    queue = [0]

    ans = 1
    visited.add(0)

    while len(queue) > 0:
        pos = queue.pop(0)
        x = pos // n
        y = pos % n

        for offsetX, offsetY in offsets:
            newX = x + offsetX
            newY = y + offsetY

            if newX < 0 or newX >= m or newY < 0 or newY >= n:
                continue

            if digitSums[newX] + digitSums[newY] > k:
                continue

            newPos = newX * n + newY
            if newPos in visited:
                continue
            ans += 1
            visited.add(newPos)
            queue.append(newPos)
    return ans


if m == 0 or n == 0:
    print("0")
else:
    print(bfs())
